using System;
using System.Collections.Generic;
using System.Text;

using miciv.Rendering;

namespace miciv.Geometry
{
    public class ShapeManager : HashtableManager<string, CreateShapeHandler>
    {
        protected CoreContext m_coreContext;

        public ShapeManager(CoreContext _coreContext)
        {
            this.m_coreContext = _coreContext;
            this.Add("rectangle", Shapes.ShapeRectangle.Create);
        }

        public IShape Create(string _strShape)
        {
            if (false != this.m_htblData.ContainsKey(_strShape))
            {
                CreateShapeHandler createShapeHandler = this.m_htblData[_strShape] as CreateShapeHandler;
                if (null != createShapeHandler)
                {
                    return createShapeHandler();
                }
            }
            return null;
        }
    }
}
